-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Replace atLeastAndMostLike by constrainedArrayLike #327
Conversation
Hey Tien,
This scenario is not allowed, see https://docs.pact.io/faq#why-is-there-no-support-for-specifying-optional-attributes. I'd suggest modelling based on the names here, for consistency across languages: https://github.com/pact-foundation/pact-js/blob/master/src/v3/matchers.ts |
I updated my example so it make more sense why I use
Yes, I agree with it. But it's a pain to implement it. e.g. I will need to split a single test to multiple tests:
I tried
Let me mark this PR Draft for now, I will continue trying to make |
Looks good to me, Could we update the matchers docs for this matcher https://github.com/pact-foundation/pact-php/blob/ffi/README.md?plain=1#L154 example from the pact-js Note:- probably need to update the all the matchers there but can do that in a sep PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion on updating README, otherwise great work
Just requesting your eyes across this @mefellows |
Update |
Thanks @tienvx I'll get this merged and then get |
Thanks, the constrained version of the function looks OK to me
Yes, it is, but that's kind of the price you pay for those guarantees :) |
Old descriptionatLeastAndMostLike
is my invention from #310, and I don't think it's useful. Instead, I replace it witharrayLike
(which is also my invention).arrayLike
do whatatLeastAndMostLike
do, which is checking bothmin
andmax
, but it also:$matcher->like()
)atLeastAndMostLike
above)for example (UPDATED):
Link to specifications:
Code taken from pact-js